Skip to content

feat(whispering): add dev-only debug page for workspace metrics and stress testing#1545

Merged
braden-w merged 2 commits intomainfrom
feat/debug-storage-page
Mar 20, 2026
Merged

feat(whispering): add dev-only debug page for workspace metrics and stress testing#1545
braden-w merged 2 commits intomainfrom
feat/debug-storage-page

Conversation

@braden-w
Copy link
Member

Adds a debug page at /debug (dev-only, import.meta.env.DEV guard) for monitoring workspace storage and stress-testing at scale.

The page started as a comprehensive spec with browser quota monitoring, tombstone analysis, and persistent storage requests—most of which turned out to be unnecessary. Browser quota is ~77GB on a 512GB Mac (non-issue), tombstones compact to ~2 bytes each with gc: true (confirmed by existing benchmarks), and Tauri apps don't face storage eviction. What remained were the two things you can't see today: how big is the Y.Doc, and what happens when you throw thousands of rows at it.

The implementation uses two independent factory functions (createMetrics, createStressTest) that co-locate reactive $state with their operations. The component orchestrates them: { stressTest.generate(); metrics.refresh(); }. No callbacks or coupling between factories.

<!-- Template reads naturally -->
{formatBytes(metrics.current.ydocSize)}
{metrics.current.tables[0].count}

<Button onclick={() => { stressTest.generate(); metrics.refresh(); }}>
<Button onclick={() => { stressTest.deleteAll(); metrics.refresh(); }}>

What it shows:

  • Y.Doc encoded size (human-readable + raw bytes)
  • Per-table row counts for all 5 workspace tables
  • Stress test panel: count selector (100–10K), content length selector (short/medium/long), Generate and Delete All with timing results (duration, throughput, size before/after/delta)

Changelog

  • Add dev-only debug page at /debug for workspace metrics and stress testing

…tress testing

Provides Y.Doc size monitoring, per-table row counts, and bulk
recording generation/deletion with timing results. Helps developers
understand storage costs and stress-test at scale without leaving
the app.

Uses factory function pattern (createMetrics, createStressTest) to
co-locate reactive state with its operations. Dev-only via
import.meta.env.DEV guard.
… nav link

Remove onComplete callback coupling between createStressTest and
createMetrics—the template now calls both explicitly. Remove debug
nav link from NavItems since it only renders in nav-items layout
mode; /debug is accessible via URL directly.
@github-actions
Copy link
Contributor

Thank you for your contribution! Before we can merge this PR, we need you to sign our Contributor License Agreement. This is a one-time requirement—it lets us offer commercial licenses for the sync server while you retain full copyright on your code.

To sign, please comment on this PR with:

I have read the CLA Document and I hereby sign the CLA


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@braden-w braden-w merged commit 019f686 into main Mar 20, 2026
1 of 10 checks passed
@braden-w braden-w deleted the feat/debug-storage-page branch March 20, 2026 02:11
@github-actions github-actions bot locked and limited conversation to collaborators Mar 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant